package com.java.test.juanzi;

public class A  {
	public static void main(String[] args) {
		test05();
	}

	/**
	 * 二维数组的初始化
	 */
	public static void test01() {
		int[][] arr = new int[4][];
		// 定义每一行的数
		arr[0] = new int[4];
		arr[1] = new int[3];
		arr[2] = new int[2];
		arr[3] = new int[1];
		// 打印二维数组
		for (int i = 0; i < arr.length; i++) {
			for (int j = 0; j < arr[i].length; j++) {
				System.out.print(" " + arr[i][j]);
			}
			System.out.println();
		}
	}

	public static void test02() {
		int[][] a = new int[5][6];
		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				System.out.print(" " + a[i][j]);
			}
			System.out.println();
		}
	}

	public static void test03() {
		int[][] a = { { 4, 1, 3 }, { 5, 8, 6, 4 }, { 4, 2, 8, 6, 45 } };
		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				System.out.print(" " + a[i][j]);
			}
			System.out.println();
		}
	}

	public static void test04() {
		int[][] a = new int[][] { { 4, 1, 3 }, { 5, 8, 6, 4 }, { 4, 2, 8, 6, 45 } };
		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				System.out.print(" " + a[i][j]);
			}
			System.out.println();
		}
	}

	public static void test05() {
		int[][] arr = new int[5][];
		arr[0] = new int[5];
		arr[1] = new int[5];
		arr[2] = new int[5];
		arr[3] = new int[5];
		arr[4] = new int[5];
		for (int i = 0; i < arr.length; i++) {
			for (int j = 0; j < arr[i].length; j++) {
				System.out.print(" " + arr[i][j]);
			}
			System.out.println();
		}
	}
}
